﻿using Anderson.PluginFramework;

public class ListenerPlugin : IPluginActivator, IFrameworkListener, IPluginListener, IServiceListener
{
    public void FrameworkChanged(FrameworkEventArg arg)
    {
        plugin.Log.Debug(string.Format("FrameworkChanged : {0}", arg.State));
    }

    public void PluginChanged(PluginEventArg arg)
    {
        plugin.Log.Debug(string.Format("PluginChanged {0} : {1}" , arg.Plugin.Entity.pluginName, arg.State));
    }

    public void ServiceChanged(ServiceEventArg arg)
    {
        plugin.Log.Debug(string.Format("ServiceChanged {0} : {1}", arg.Plugin.Entity.pluginName, arg.State));
    }

    #region IPluginActivator
    private IPlugin plugin;
    public void Init(IFramework framework, IPlugin plugin)
    {
        this.plugin = plugin;
        plugin.Log.Debug("ListenerPlugin.Init");
    }

    public void Run()
    {
        plugin.Log.Debug("ListenerPlugin.Run");
    }

    public void Stop()
    {
        plugin.Log.Debug("ListenerPlugin.Stop");
    }
    #endregion


}
